 cordova.define("easysw-plugin-toolbar", function(require, exports, module) {

var exec = require('cordova/exec');

var toolbar = {

    /**
     * 设置标题栏
     * @params title 标题
     */
    setTitle:function(successCallback, failureCallback,title){
        exec(successCallback, failureCallback, 'Toolbar', 'setTitle',[title]);
    },

    /**
     * 设置右边菜单
     * @params menu 菜单数组结构
     *
     *  e.g
        [ {"text":"消费记录","icon":"file:///android_assert/www/1.png","jsCallback":"callback_1"},
          {"text":"订餐记录","icon":"file:///android_assert/www/2.png","jsCallback":"callback_2"}
        ]
     */
    setRightButton:function(successCallback, failureCallback,menu){
        exec(successCallback, failureCallback, 'Toolbar', 'setRightButton',[menu]);
    },

};

module.exports = toolbar
});